import http from "@/utils/http.js"

const url = {
    // 查询设备列表
    queryFacility: "/facility/queryFacility",
    // 查询设备概况信息
    facilitySituation: "/facility/facilitySituation/",
    // 录入设备信息
    insertFacility: "/facility/insertFacility",
    // 录入设备信息
    fileUpload: "/facility/fileUpload",
    // 查询各分厂的设备分类
    getFacilitySort: "/facility/getFacilitySort/",
    // 导出设备信息
    exportFacility: "/facility/exportFacility",
    // 修改设备信息
    updateFacility: "/facility/updateFacility",
    // 批量录入设备信息
    batchInsertFacility: "/facility/batchInsertFacility",
    // 批量修改设备信息
    batchUpdateFacility: "/facility/batchUpdateFacility",
    // 查询设备的联网推送数据详情
    getFacilityDetail: "/facility/getFacilityDetail",
}

export default {
    url: url,
    // 查询设备列表
    queryFacility(params) {
        return http.post(url.queryFacility, params)
    },
    // 查询设备概况信息
    facilitySituation(params) {
        return http.post(url.facilitySituation + params)
    },
    // 录入设备信息
    insertFacility(params) {
        return http.post(url.insertFacility, params)
    },
    // 导入大屏所有模块
    fileUpload(params) {
        return http.post(url.fileUpload, params, 'formData')
    },
    // 查询各分厂的设备分类
    getFacilitySort(params) {
        return http.post(url.getFacilitySort + params)
    },
    // 导出设备信息
    exportFacility(params) {
        return http.export(url.exportFacility, params, 'post')
    },
    // 修改设备信息
    updateFacility(params) {
        return http.post(url.updateFacility, params)
    },
    // 批量录入设备信息
    batchInsertFacility(params) {
        return http.post(url.batchInsertFacility, params)
    },
    // 批量修改设备信息
    batchUpdateFacility(params) {
        return http.post(url.batchUpdateFacility, params)
    },
    // 查询设备的联网推送数据详情
    getFacilityDetail(params) {
        return http.post(url.getFacilityDetail, params)
    },
}